Absolute Motion

During the first week we discussed reference frames and coordinate systems to represent the motion of particles. This was the “absolute motion” that was always measured relative to a fixed reference frame.

Let's define the fixed reference frame to be A

The particle moves in 3D. The point the particle is located is denoted P.

Example 1: We observe a statue located at position P.


In [1]:
from rel_motion import *
# Fixed Frame A
A = np.eye(3) # identity matrix E1=(1,0,0), E2=(0,1,0), E3=(0,0,1)
rO = np.array((0,0,0))
rP = np.array( (5, 0, 0))
plotAbsMotion(A, rO, rP)


Example 2: a projectile is launched into the air from the ground with an initial velocity v0 in the x,y, and z directions. Assuming only gravity is acting on the projectile, what is it's equation of motion? What about when the velocity is 0.5v0?

$^Ar_P(t) = v_0t\hat{E}_1 + v_0t\hat{E}_2 + (v_0t - \frac{1}{2}gt^2) \hat{E}_3$


In [2]:
from rel_motion import *
# define path of trajectory for particle P observed in fixed frame A

def projectile(v0,t):
    x = v0*t
    y = v0*t
    z = v0*t - 0.5*g*t**2
    return [x,y,z]

T = np.linspace(0, 1, 100)
v0 = 5
x_t1 = np.array([projectile(v0,t) for t in T])
x_t2 = np.array([projectile(v0/2., t) for t in T])
#origin as function of T
o_t = np.array([ [0,0,0] for t in T])

ntc = [('rP1', (o_t,x_t1), blue), 
       ('rP2', (o_t,x_t2), green)]

# run animation
%matplotlib 
fig, args = runAnimation(ntc)
anim = animation.FuncAnimation(fig, **args)
plt.show()


Using matplotlib backend: Qt5Agg

Relative Motion

During the first week we discussed reference frames and coordinate systems to represent the motion of particles. This was the “absolute motion” that was always measured relative to a fixed reference frame.

This week we are going to discuss relative motion. In this case observations are made in a moving reference frame.

Example case: I am in car driving in a straight line at 60 mph on the highway. A car passes me going 20 mph faster than I am. How fast is the car going?

For this discussion, we will assume there is a fixed reference frame A and a moving reference frame B.

  • The fixed frame A’s coordinate system is represented by the basis {E1,E2,E3}
  • The moving frame B’s coordinate system is represented by the basis {e1,e2,e3}
  • O is the position of A’s origin
  • Q is the position of B’s origin
  • P is a moving point observed

In [2]:
from rel_motion import *


%matplotlib 
import time

# Fixed Frame A
A = np.eye(3) # identity matrix E1=(1,0,0), E2=(0,1,0), E3=(0,0,1)
rO = np.array((0,0,0))

# Moving Frame B
B = np.eye(3) # identity matrix
rQ = np.array([5., 5., 5.])

# moving point P observed in B
rPQ = np.array((0.,0.,0.))

# point P observed in A?
rP = rQ  + rPQ


# Position of rQ

vQ= np.array([1., 0., 0.])
vPQ = np.array([3.,0.0,0.])


dt = 4

plotAll(A, B, rO, rQ, rPQ, rP)
ax =plt.gca()
fig = plt.gcf()

for i in range(10):
    rQ += vQ*dt
    rPQ += vPQ*dt
    rP = rQ + rPQ
    plotAll(A, B, rO, rQ, rPQ, rP, ax, labels=False)
plotAll(A, B, rO, rQ, rPQ, rP, ax)


plt.show()


Using matplotlib backend: Qt5Agg

In [3]:
from rel_motion import *


%matplotlib 
import time

# Fixed Frame A
A = np.eye(3) # identity matrix E1=(1,0,0), E2=(0,1,0), E3=(0,0,1)
rO = np.array((0,0,0))

# Moving Frame B
B = np.eye(3) # identity matrix
rQ = np.array([5., 5., 5.])

# moving point P observed in B
rPQ = np.array((0.,0.,0.))

# point P observed in A?
rP = rQ  + rPQ


# Position of rQ

vQ= np.array([1., 0., 0.])
vPQ = np.array([3.,0.0,0.])


dt = 4

plotAll(A, B, rO, rQ, rPQ, rP)
ax =plt.gca()
fig = plt.gcf()

for i in range(10):
    rQ += vQ*dt
    rPQ += vPQ*dt
    rP = rQ + rPQ
    plotAll(A, B, rO, rQ, rPQ, rP, ax, labels=False)
plotAll(A, B, rO, rQ, rPQ, rP, ax)

plt.cla()
plt.show()


Using matplotlib backend: Qt5Agg

In [1]:
from rel_motion import *
# define path of trajectory for particle P observed in fixed frame A

def applyVel(T, p0, vel):
    p_t = np.array([p0 + vel(t)*t for t in T])
    return p_t



def vO(t):
    return np.array([0., 0., 0.])
def vQ(t):
    return np.array([2., 0., 0.])
def vPQ(t):
    return np.array([3., 0., 0.])

def compute_rP(rQ, rPQ, vQ, vPQ, t):
    return np.array((rQ + rPQ).tolist())

T = np.linspace(0, 1, 100)

#initial values
rO0 = np.array([0., 0., 0.])
rQ0 = np.array([5., 5., 5.])
rPQ0 = np.array((0.,0.,0.))
rP0 = compute_rP(rQ0, rPQ0, vQ, vPQ, 0)



rO_t = applyVel(T, rO0, vO)
rQ_t = applyVel(T, rQ0, vQ)
rPQ_t = applyVel(T, rPQ0, vPQ)
rP_t = np.array([compute_rP(q_i, pq_i, vQ, vPQ, t_i) for (q_i, pq_i, t_i) in zip( rQ_t, rPQ_t, T) ])


names = ['rO', 'rQ', 'rPQ', 'rP']
colors = [red, black, green, blue]

trajs = [
(rO_t, rO_t),
(rO_t, rQ_t),
(rQ_t, rPQ_t),
(rO_t, rP_t)
]


ntc = zip(names, trajs, colors)

# run animation
%matplotlib 
fig, args = runAnimation(ntc)
anim = animation.FuncAnimation(fig, **args)
plt.show()


Using matplotlib backend: Qt5Agg

In [ ]:


In [ ]:


In [ ]: